﻿// -----------------------------------------------------------------------
// <copyright file="BuildTestInterfacesMenu.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Ex04.Menus.Test
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Ex04.Menus.Interfaces;
    using Ex04.Menus.Test.Functions;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class BuildTestInterfacesMenu
    {
        private MainMenu m_Menu;

        public BuildTestInterfacesMenu()
        {
            m_Menu = new MainMenu("Interface - Garage Menu");
        }

        public void BuildIntrfaceMenu()
        {
            MenuItem option1 = new SubMenu("Add New Vehicle");
            m_Menu.AddMenuItem(option1);
            MenuItem option1_1 = new ActionMenu("Add Random Vehicle", new AddRandomVehicle());
            m_Menu[1].AddMenuItem(option1_1);
            MenuItem option1_2 = new SubMenu("Choose vehicle to add");
            m_Menu[1].AddMenuItem(option1_2);
            MenuItem option1_2_1 = new ActionMenu("Add car to garage", new AddCar());
            ((m_Menu[1] as SubMenu)[2] as SubMenu).AddMenuItem(option1_2_1);
            MenuItem option1_2_2 = new ActionMenu("Add motorcycle to garage", new AddMotorcycle());
            ((m_Menu[1] as SubMenu)[2] as SubMenu).AddMenuItem(option1_2_2);

            MenuItem option2 = new SubMenu("Show vehicles details");
            m_Menu.AddMenuItem(option2);
            MenuItem option2_1 = new SubMenu("Show filtered details");
            m_Menu[2].AddMenuItem(option2_1);
            MenuItem option2_1_1 = new ActionMenu("Show car details", new CarDetails());
            MenuItem option2_1_2 = new ActionMenu("Show motorcycle details", new MotorcycleDetails());
            ((m_Menu[2] as SubMenu)[1] as SubMenu).AddMenuItem(option2_1_1);
            ((m_Menu[2] as SubMenu)[1] as SubMenu).AddMenuItem(option2_1_2);
            MenuItem option2_2 = new ActionMenu("Show all vehicles details", new AllVehiclesDetails());
            m_Menu[2].AddMenuItem(option2_2);

            MenuItem option3 = new ActionMenu("Refuel vehicle", new RefuelVehicle());
            m_Menu.AddMenuItem(option3);

            MenuItem option4 = new ActionMenu("Recharge vehicle", new RechargeVehicle());
            m_Menu.AddMenuItem(option4);
        }

        public void ShowMenu()
        {
            m_Menu.Show();
        }
    }
}
